<?php
/**
 * View padrão de uma página do site
 */
$classe = $this->classe;
if (empty($classe)) {
	$request = Zend_Controller_Front::getInstance()->getRequest();
	$classe = $request->getControllerName();
}
$url = (empty($this->url)) ? $classe : $this->url;
if (substr($url, -1) != '/') {
	$url .= '/';
}
$limite = (empty($this->limite)) ? 10 : $this->limite;
$pagina = (empty($this->pagina)) ? 1 : $this->pagina;
$totalPaginas = $this->totalPaginas;

$this->headScript()->prependFile($this->baseUrl('_js/jquery.ajaxLista.js'));

if (!$this->layout()->isEnabled()) {
	echo $this->headLink();
	echo $this->headScript();
}
?>
<script type="text/javascript">
$(function(){
	//paginacao Ajax
	$('.<?php echo $classe; ?>').ajaxLista({
		url: '<?php echo $url . 'lista'; ?>',
		pagina: <?php echo $pagina; ?>,
		limite: <?php echo $limite; ?>
<?php
if (!empty($totalPaginas)) {
?>
		, totalPaginas: <?php echo $totalPaginas; ?>
<?php
}
?>
	});

});
</script>
<div class="<?php echo $classe; ?>"><?php
if (count($this->rs) > 0) {
?>
	<div class="pagina <?php echo $pagina; ?>">
<?php
	foreach ($this->rs as $i => $r) {
		echo $this->partial('resumo.phtml', array('r' => $r, 'url' => $url));
	}
?>
	</div>
<?php
}
?></div>